from time import sleep
from page_locators.login_page_locator import LoginPageLocators as LPL
from page_locators.class_students_locator import ClassStudentsLocator as CSL
from common.base_page import BasePage 
from test_datas.class_students_datas import *
from test_datas.pic_data import *


class ClassStudents(BasePage):

    def __init__(self, driver):
        super().__init__(driver)

    def bulk_import_students_info(self):
        self.click(CSL.status_register, "学籍注册按钮定位失败截图")
        self.click(CSL.bulk_import, "批量导入按钮定位失败截图")
        self.upload_file(CSL.click_input, students_info_excel, "点击上传按钮定位失败截图")
        self.click(CSL.click_import, '导入按钮定位失败截图')
        sleep(10)
        self.click(CSL.sure, '批量添加确定按钮定位失败截图')

        # self.click(LPL.digital_class_management_loc, '数字化班级管理按钮定位错误截图')

    # def bulk_del_students_info(self):

    def class_student_click(self):
        self.click(CSL.class_student, "班级学生按钮定位失败截图")

    def bulk_import_pic(self):
        self.click(CSL.bulk_import_pic, "批量导入照片按钮定位失败截图")

    def input_label_error(self):
        self.bulk_import_pic()
        self.upload_file(CSL.input_label, facepic_webp, "批量上传人脸信息input标签定位失败截图")

    def input_label_success1(self):
        self.bulk_import_pic()
        self.upload_file(CSL.input_label, facepic_png, "批量上传人脸信息input标签定位失败截图")
        self.click(CSL.face_pic_sure, "批量上传人脸信息确定按钮定位失败截图")

    def input_label_success2(self):
        self.bulk_import_pic()
        self.upload_file(CSL.input_label, facepic_jpg, "批量上传人脸信息input标签定位失败截图")
        self.click(CSL.face_pic_sure, "批量上传人脸信息确定按钮定位失败截图")